<style>
    .ui-popup-modal .ui-dialog-body {
        padding: 0;
    }
</style>
<form class="edit-delivery-info" novalidate name="edit">
    <div class="section">
        <h3 class="title">客户经理信息</h3>
        <table>
            <tr ng-repeat="customManage in profile.custom_manage">
                <td>
                    <span>姓名：</span>
                    <i class="glyphicon glyphicon-search"></i>
                    <input class="form-control" id="{{'edit-delivery-info-username' + customManage.id}}" type="text"
                           placeholder="请输入姓名"
                           name="clientName"
                           data-type="custom_manage"
                           ng-model="customManage.name">
                </td>
                <td>
                    <span>手机：</span>
                    <input class="form-control" type="text" placeholder="请输入手机号"
                           name="clientPhone"
                           ng-model="customManage.mobile"
                           disabled>
                </td>
                <td>
                    <span>邮箱：</span>
                    <input class="form-control" style="width: 240px" type="text" placeholder="请输入邮箱"
                           name="clientEmail"
                           ng-model="customManage.email"
                           disabled>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="hint" ng-show="edit.clientName.$error.required">请输入姓名</div>
                </td>
            </tr>
        </table>
    </div>

    <div class="section">
        <h3 class="title">交付顾问信息</h3>
        <table>
            <tr ng-repeat="deliver in profile.deliver">
                <td style="padding-bottom: 10px;">
                    <span>姓名：</span>
                    <i class="glyphicon glyphicon-search"></i>
                    <input class="form-control" id="{{'edit-delivery-info-username' + deliver.id}}" type="text"
                           placeholder="请输入姓名"
                           name="counselorName"
                           data-type="deliver"
                           ng-model="deliver.name">
                </td>
                <td style="padding-bottom: 10px;">
                    <span>手机：</span>
                    <input class="form-control" type="text" placeholder="请输入手机号"
                           name="counselorPhone"
                           ng-model="deliver.mobile"
                           disabled>
                </td>
                <td style="padding-bottom: 10px;">
                    <span>邮箱：</span>
                    <input class="form-control" style="width: 240px" type="text" placeholder="请输入邮箱"
                           name="counselorEmail"
                           ng-model="deliver.email"
                           disabled>
                </td>
                <td style="padding-bottom: 10px; padding-left: 10px">
                    <a class="tab-text-important" ng-if="profile.deliver.length > 1"
                       ng-click="localRemove('deliver', deliver)">删除</a>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="hint" ng-show="edit.counselorName.$error.required">请输入姓名</div>
                </td>
            </tr>
            <tr>
                <td class="4">
                    <p class="mt10"><a class="tab-text" ng-click="localAdd('deliver')">+增加</a></p>
                </td>
            </tr>
        </table>
    </div>

    <div class="section" ng-if="historyList && historyList.length">
        <h3 class="title">历史记录</h3>
        <div class="history">
            <table>
                <tr ng-repeat="item in historyList" ng-init="historyListLength = historyList.length">
                    <td class="text-center" width="40">{{ historyListLength - $index }}</td>
                    <td>
                        <p>
                            <time>时间：{{ item.create_on }}</time>
                            <span>操作人：{{ item.username }}</span>
                        </p>
                        <p>
                            调整前信息：
                            客户经理是 <span ng-repeat="customManage in item.custom_manage">{{ customManage.name }} ( {{ customManage.phone }} )、</span>
                            交付顾问是 <span ng-repeat="deliver in item.deliver">{{ deliver.name }} ( {{ deliver.phone }} ) {{ $index < item.deliver.length - 1 ? '、' : '' }}</span>
                        </p>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>